//
//  TabBarController.m
//  WhoElse
//
//  Created by 孙宇鹏 on 15/11/16.
//  Copyright © 2015年 sunsystem. All rights reserved.
//

#import "TabBarController.h"
#import "ResourceViewController.h"
#import "HeroViewController.h"
#import "VideoViewController.h"
#import "SearchViewController.h"

@interface TabBarController ()

@end

@implementation TabBarController

- (void)viewDidLoad {
    [super viewDidLoad];

    ResourceViewController *resourceVC = [[ResourceViewController alloc]init];
    UINavigationController *resourceNC = [[UINavigationController alloc]initWithRootViewController:resourceVC];
    resourceNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"资讯" image:[UIImage imageNamed:@"Resource1"] selectedImage:[UIImage imageNamed:@"Resource2"]];
    
    HeroViewController *heroVC = [[HeroViewController alloc]init];
    UINavigationController *heroNC = [[UINavigationController alloc]initWithRootViewController:heroVC];
    heroNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"英雄" image:[UIImage imageNamed:@"Hero1"] selectedImage:[UIImage imageNamed:@"Hero2"]];
    
    VideoViewController *videoVC = [[VideoViewController alloc]init];
    UINavigationController *videoNC = [[UINavigationController alloc]initWithRootViewController:videoVC];
    videoNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"视频" image:[UIImage imageNamed:@"Video1"] selectedImage:[UIImage imageNamed:@"Video2"]];
 
    SearchViewController *searchVC = [[SearchViewController alloc]init];
    UINavigationController *searchNC = [[UINavigationController alloc]initWithRootViewController:searchVC];
    searchNC.tabBarItem = [[UITabBarItem alloc]initWithTitle:@"查询" image:[UIImage imageNamed:@"Search1"] selectedImage:[UIImage imageNamed:@"Search2"]];
    
    self.viewControllers = @[resourceNC, heroNC, videoNC, searchNC];
    
    [self setNeedsStatusBarAppearanceUpdate];
    
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

@end
